
{extend name='public/base' /}

{block name="content"}

<div class="layui-col-md12">
    <div class="layui-card">
        <div class="layui-card-body">
            <table class="layui-hide" id="get_cost_type_select_table" lay-filter="get_course_select_table"></table>
        </div>
    </div>

</div>
{/block}

{block name="js"} <!--js处理区-->


<script type="text/html" id="operationTpl">
    {{# if(d.id==0){ }}
     不可编辑
    {{# }else{ }}
    <a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs {:node('Admin/addAdmin')}" data-title="编辑订单" lay-event="edit"><i class="layui-icon"></i></a>
    <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs {:node('Admin/del')}" data-title="删除订单" lay-event="del"><i class="layui-icon "></i></a>
    {{# } }}
</script>

<script>
    layui.use(['element', 'table', 'form', 'jquery', 'lucky','opTable'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;
        var opTable = layui.opTable;
        var table = layui.table;
        form.render();

        var opTables = table.render({
            elem: '#get_cost_type_select_table',
            url:"{:url('admin/CostType/index')}",
            even: true, //开启隔行背景
            id:'get_cost_type_select_table_id',
            page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip','last'] //自定义分页布局
                ,groups: 5 //只显示 1 个连续页码
                ,first: false //不显示首页
                ,last: false //不显示尾页
                ,limit:20
                ,limits:[10,20,30,50]
            },
              // height: 'full-100',100',
            text: {
                none: '暂无相关数据'
            },
            cols: [[
                {title: '', type: 'checkbox', fixed: true},
                {title: 'UID', field: 'id'},
                {title: '收费名称', field: 'name', edit: 'text'},
                {
                    title: '收费类型', field: 'type', templet: function (item) {
                        var type = item.type
                        if (type == 1) {
                            return '保证金'
                        } else if (type == 2) {
                            return '押金'
                        } else if (type == 3) {
                            return '费用'
                        } else {
                            return '未知类型'
                        }
                    }
                },
                {
                    title: '资金流', field: 'pay_type', templet: function (item) {
                        return item.pay_type == 1?'入账':'出账'
                    }
                },
                {title: '创建时间', field: 'create_time', edit: 'text'},
                {title: '更新时间', field: 'update_time', edit: 'text'}
            ]],
            done: function (res) {
                layer.closeAll('loading');
            }
        });


    });

</script >

{/block}
